feat(demo): add Scriptor 2.0 Docker demo stack#41
Merged
Conversation
Adds a one-command Docker stack to try Scriptor 2.0 without installing
PHP, Composer, or SQLite locally:
docker compose up -d --build
…brings Scriptor up on http://localhost:8080 with a single admin user
(admin / scriptor) and one example page seeded on first start.
Stack shape (matches the iManager deployment guide):
- `scriptor` service — php:8.3-fpm-alpine with the iManager extensions
(pdo_sqlite, mbstring, gd, dom, zip, opcache), production-shaped
opcache (with timestamp validation on so demo restarts pick up code
changes), Composer install of bigins/scriptor + bigins/imanager.
- `web` service — nginx:alpine fronting it; standard front-controller
routing with /data/uploads-2.0/ served directly and the rest of
data/ blocked at the URL layer.
- Both services mount a shared named volume `scriptor-app` at
/var/www/scriptor; web mounts it read-only.
- `docker compose down -v` resets the demo to factory state.
Composer install in the image overrides composer.json's path-repo
(`../imanager`) with a VCS repo pointing at the public iManager
GitHub repo, so the demo build doesn't need a sibling iManager
checkout.
Seed (docker/seed-demo.php) is idempotent. It runs on first start
only — if a `pages` category already exists it exits cleanly. It
creates:
- Pages category + 7 fields (slug, parent, pagetype, menu_title,
content, template, images).
- Users category + 3 fields (role, email, password).
- Admin user — `admin` / `scriptor`, role=admin. Password is passed
as plaintext to ItemRepository::save() so the PasswordFieldType
does the bcrypt hashing.
- One Hello-world example page that explains what's been seeded.
Schema migrations are reapplied on every container start (cheap
no-op when already current). The library's `DefaultBootstrap` would
auto-migrate on first PDO resolve anyway; the explicit step in the
entrypoint gives clearer log output and survives a future entrypoint
that doesn't immediately open a connection.
Files:
- docker/Dockerfile (74 lines)
- docker/nginx.conf (75 lines)
- docker/entrypoint.sh (43 lines)
- docker/seed-demo.php (138 lines, idempotent seed)
- docker-compose.yml (45 lines)
- docs/demo.md (149 lines — quickstart + what-the-seed-
creates + explorations + reset + when-
NOT-to-use)
- README.md (+ a "Try it in Docker" subsection
pointing at docs/demo.md)
This rounds out the Phase 16 deliverables on the Scriptor side; the
library-side docs (API ref, cookbooks, deployment guide, migration
guide) all landed earlier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a one-command Docker stack to try Scriptor 2.0 without installing PHP, Composer, or SQLite locally:
…brings Scriptor up on http://localhost:8080 with a single admin user (admin / scriptor) and one example page seeded on first start.
Stack shape (matches the iManager deployment guide):
scriptorservice — php:8.3-fpm-alpine with the iManager extensions (pdo_sqlite, mbstring, gd, dom, zip, opcache), production-shaped opcache (with timestamp validation on so demo restarts pick up code changes), Composer install of bigins/scriptor + bigins/imanager.webservice — nginx:alpine fronting it; standard front-controller routing with /data/uploads-2.0/ served directly and the rest of data/ blocked at the URL layer.scriptor-appat /var/www/scriptor; web mounts it read-only.docker compose down -vresets the demo to factory state.Composer install in the image overrides composer.json's path-repo (
../imanager) with a VCS repo pointing at the public iManager GitHub repo, so the demo build doesn't need a sibling iManager checkout.Seed (docker/seed-demo.php) is idempotent. It runs on first start only — if a
pagescategory already exists it exits cleanly. It creates:admin/scriptor, role=admin. Password is passed as plaintext to ItemRepository::save() so the PasswordFieldType does the bcrypt hashing.Schema migrations are reapplied on every container start (cheap no-op when already current). The library's
DefaultBootstrapwould auto-migrate on first PDO resolve anyway; the explicit step in the entrypoint gives clearer log output and survives a future entrypoint that doesn't immediately open a connection.Files:
creates + explorations + reset + when-
NOT-to-use)
pointing at docs/demo.md)
This rounds out the Phase 16 deliverables on the Scriptor side; the library-side docs (API ref, cookbooks, deployment guide, migration guide) all landed earlier.